#ifndef FSM_H__
#define FSM_H__
#define BUF_SIZE 4096

typedef void *fsm_st;

enum
{
    STATE_R = 1,
    STATE_W,
    STATE_EX,
    STATE_T
};

int fsm_state(fsm_st fsm);

void fsm_drive(fsm_st fsm);

fsm_st fsm_new(int src, int dst);

void fsm_close(fsm_st p);

const char *fsm_error(fsm_st p);

#endif
